Skip to content

Add scdblfinder module - #13465

Merged
vagkaratzas merged 6 commits into
nf-core:masterfrom
iraajgangavaram:add-scdblfinder-module
Oct 29, 2026
Merged

vagkaratzas merged 6 commits into
nf-core:masterfrom
iraajgangavaram:add-scdblfinder-module

Conversation

@iraajgangavaram

Copy link
Copy Markdown
Contributor

PR checklist

Closes #XXX

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs
  • If necessary, include test data in your PR.
  • Remove all TODO statements.
  • Broadcast software version numbers to topic: versions - See version_topics
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test <MODULE> --profile docker
      • nf-core modules test <MODULE> --profile singularity
      • nf-core modules test <MODULE> --profile conda
    • For subworkflows:
      • nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows test <SUBWORKFLOW> --profile conda

@github-actions

Copy link
Copy Markdown

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@iraajgangavaram

Copy link
Copy Markdown
Contributor Author

Most of the lines here are the generated conda lock files (over 6,600). The module itself is five small files.

@nictru

nictru commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Two things:

  1. Please store the h5ad with compression = 'gzip', I recently added this for all modules in scdownstream
  2. scdownstream can run multiple doublet detection methods in parallel. Then it takes a boolean column from each of them, sums them up and applies a user-defined threshold. This PR does not contain the boolean column, so it would cause problems with integrating in scdownstream. Maybe you can write an additional csv doublet_calls.csv or something like that, which contains exactly just the boolean column, and is thus compatible with scdownstream. We should have a standard interface for all doublet detection methods, so that they can be used in parallel without an additional unification process afterwards.

Write the h5ad with gzip compression, as in the other scdownstream modules.

The predictions output is now a CSV with a single boolean column (true for
doublets), named after the prefix and indexed by cell barcode. This matches
the layout of the other doublet detection modules, so scdownstream can combine
them. The full scDblFinder table (class, score and related columns) moves to
a new scores output.
@iraajgangavaram

Copy link
Copy Markdown
Contributor Author

Thanks, both done. The h5ad is now written with gzip compression. The predictions output is now a CSV with only the boolean doublet column (named after the prefix, one row per cell barcode), which is the layout DOUBLETREMOVAL reads, so it can be combined with the other methods. I moved the full scDblFinder table (class, score and so on) into a separate scores output.

@vagkaratzas vagkaratzas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Blocking: the test assertions do not follow the sanitizeOutput(process.out) rule, so the CSV outputs are never checked.
  • Blocking: dbr and batch_col should go through ext.args, and the template needs to honour task.ext.args; output paths should use ${prefix} rather than globs.
  • Minor: implicit it in tests, missing ontologies on the versions entries in meta.yml.

Gates: lint and nf-test taken from CI (both green); nextflow lint run locally, no errors.

Diff 7.96/10 · Overall 7.96/10
nf-core-reviewer 0.5.0 / vagkaratzas-review (rubric v4) · claude-sonnet-5-5

Comment thread modules/nf-core/scdblfinder/main.nf Resolved
Comment thread modules/nf-core/scdblfinder/main.nf Resolved
Comment thread modules/nf-core/scdblfinder/meta.yml Resolved
Take only the meta and h5ad as inputs and pass dbr, samples and other
scDblFinder options through task.ext.args, with a tests/nextflow.config that
sets ext.args from params.module_args. A single string given as samples is
read as the name of an obs column.

Use ${prefix} in the output paths instead of globs, add the YAML ontology to
the versions entries in meta.yml, name the test closure parameters, and
snapshot the predictions file in the real tests.
@iraajgangavaram

Copy link
Copy Markdown
Contributor Author

Thanks for the review, all points are addressed. dbr and batch_col are gone from the inputs and everything goes through ext.args now (e.g. dbr = 0.08, samples = "batch"), with tests/nextflow.config setting ext.args from params.module_args. Outputs use ${prefix} paths, the versions entries have the YAML ontology, and the closures are named. In the real tests I snapshot the predictions CSV, the versions and adata.yaml rather than the whole sanitizeOutput(process.out), because the h5ad checksum and the float scores can differ between platforms. Happy to switch to the full snapshot if you prefer.

@vagkaratzas vagkaratzas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates! The ext.args handling, the ${prefix} output names, the named closure parameters and the versions ontologies are all fixed now.

  • Blocking: the non-stub tests still don't snapshot sanitizeOutput(process.out). Use unstableKeys for the channels that change between runs (see the inline suggestion).
  • Blocking: versions.yml only reports R and scDblFinder. It should also report every other package in environment.yml.
  • Minor: one comment just repeats the code, and the predictions description in meta.yml is longer than one line.

Also worth doing: modules on master now start with the two-line nf-core licence header (see e.g. mafft/align/main.nf). Please add it to main.nf.

Diff 8.50/10 · Overall 8.50/10
nf-core-reviewer 0.5.0 / vagkaratzas-review (rubric v4) · claude-opus-5-5

Comment thread modules/nf-core/scdblfinder/meta.yml Resolved
Report the versions of anndataR, SingleCellExperiment, BiocParallel and rhdf5
in versions.yml, in the template and in the stub.

Snapshot sanitizeOutput(process.out) in the real tests, with the h5ad and
scores channels as unstable keys and the scores line count alongside.

Add the nf-core licence header to main.nf, shorten the predictions
description in meta.yml and drop a comment that repeated the code.

@vagkaratzas vagkaratzas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • All previous requested changes are addressed: the non-stub tests now snapshot sanitizeOutput(process.out, unstableKeys: ['h5ad', 'scores']) with the adata.yaml and scores.size() checks kept as stable replacements, versions.yml (template and stub) reports every package in environment.yml, the versions ontologies are in meta.yml, the predictions description is one line, the redundant comment is gone and the licence header is in main.nf.
  • No new findings. Lint and nf-test are green on the head commit, and nextflow lint reports no errors.

Approval should be on its way soon.

Gates: lint and nf-test taken from CI (both green); nextflow lint run locally, no errors (one "variable declared but not used" warning for args, which the template reads).

Diff 10.00/10 · Overall 10.00/10
nf-core-reviewer 0.5.0 / vagkaratzas-review (rubric v4) · claude-sonnet-5-5

@vagkaratzas vagkaratzas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@vagkaratzas
vagkaratzas added this pull request to the merge queue Oct 29, 2026
Merged via the queue into nf-core:master with commit df69bf6 Oct 29, 2026
25 checks passed
delfiterradas pushed a commit to delfiterradas/modules that referenced this pull request Oct 30, 2026
* new module: scdblfinder

* scdblfinder: add container metadata, conda locks and test snapshot

* scdblfinder: gzip the h5ad and return boolean doublet predictions

Write the h5ad with gzip compression, as in the other scdownstream modules.

The predictions output is now a CSV with a single boolean column (true for
doublets), named after the prefix and indexed by cell barcode. This matches
the layout of the other doublet detection modules, so scdownstream can combine
them. The full scDblFinder table (class, score and related columns) moves to
a new scores output.

* scdblfinder: pass options through ext.args and address review comments

Take only the meta and h5ad as inputs and pass dbr, samples and other
scDblFinder options through task.ext.args, with a tests/nextflow.config that
sets ext.args from params.module_args. A single string given as samples is
read as the name of an obs column.

Use ${prefix} in the output paths instead of globs, add the YAML ontology to
the versions entries in meta.yml, name the test closure parameters, and
snapshot the predictions file in the real tests.

* scdblfinder: report all package versions and snapshot sanitizeOutput

Report the versions of anndataR, SingleCellExperiment, BiocParallel and rhdf5
in versions.yml, in the template and in the stub.

Snapshot sanitizeOutput(process.out) in the real tests, with the h5ad and
scores channels as unstable keys and the scores line count alongside.

Add the nf-core licence header to main.nf, shorten the predictions
description in meta.yml and drop a comment that repeated the code.
mahesh-panchal pushed a commit to mahesh-panchal/nf-core-modules that referenced this pull request Nov 3, 2026
…n `scrnaseq` (nf-core#13090)

* Modify starsolo to work in scrnaseq pipeline

* Clean nextflow.config

* Update nf-test inputs

* Remove unstable files from snapshot

* Create conda-lock folder

* Starsolo multiple changes

* Update container

* Capture summary stats for bam output

* Ignore empty file

* Update meta.yml

* Update meta, output files and add tests for missing solotypes

* Update paths in the tests and update snapshots

* Get statistics instead of md5 for sam outputs

* Fix meta.yml

* Assert process success outside of assertAll

* Do not rely on a NO_FILE empty file

* Implement reviewer suggestions

* Revert change in .gitignore

* Fix linting

* Fix prek error

* Remove trailing whitespace

* Update modules/nf-core/star/starsolo/main.nf

Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>

* Update modules/nf-core/star/starsolo/main.nf

Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>

* Update modules/nf-core/star/starsolo/main.nf

Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>

* Update modules/nf-core/star/starsolo/main.nf

Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>

* Update modules/nf-core/star/starsolo/meta.yml

Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>

* Update modules/nf-core/star/starsolo/meta.yml

Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>

* Update modules/nf-core/star/starsolo/meta.yml

Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>

* parabricks/mutectcaller: pass --pon to mutectcaller, emit tbi (nf-core#13440)

* parabricks/mutectcaller: pass --pon to mutectcaller

The panel of normals was prepared with prepon and annotated with
postpon, but never passed to mutectcaller via --pon, so PON sites were
not filtered during calling.

prepon was also silently skipped whenever the index was already named
<pon>.tbi: the cp onto itself failed, and its && chain short-circuited
prepon without failing the task. Only copy the index when its name
differs.

Re-enable the PON test by reheadering the chr21 Mills VCF to the
reference contigs with bcftools/reheader in a setup block.

Generated by Claude Opus 5.5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* parabricks/mutectcaller: assert PON effect explicitly, use sanitizeOutput

Snapshot all outputs via sanitizeOutput. The PON test now asserts that
--pon reaches mutectcaller, that calls overlapping PON deletions are
dropped (and present in the tumour-only test), and that postpon flags
PON sites, instead of relying on a snapshot recorded from the fix.

Generated by Claude Opus 5.5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* parabricks/mutectcaller: read test VCFs via nft-vcf

Replace hand-rolled linesGzip/tab-split parsing with the nft-vcf
VcfFile header and VariantContext API.

Generated by Claude Opus 5.5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* parabricks/mutectcaller: add intervals and tumour-normal tests

Replace the commented-out tests. The intervals test failed only because
of the pre-nf-core#11647 input structure. For tumour-normal, the chr21 test
BAMs share read group ID and PU, so a setup step renames the normal's
read group with samtools/addreplacerg. Drop the tumour-normal +
intervals test: no somatic calls fall in the interval gaps, so it adds
nothing over the two.

Generated by Claude Opus 5.5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* parabricks/mutectcaller: emit the tabix index Parabricks writes

Parabricks writes <prefix>.vcf.gz.tbi alongside the VCF, from mutectcaller
without a PON and from postpon with one. Expose it as a tbi output so
pipelines need no separate indexing step. The index is snapshotted by name
only, as its content depends on the VCF header and varies between runs.

Generated by Claude Opus 5.5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* parabricks/mutectcaller: name outputs after the prefix

A PON index not named <pon>.tbi is copied to that name, and the copy matched
the *.vcf.gz.tbi glob, so tbi emitted two files. Name all outputs after the
prefix and test a PON with a differently named index.

Also accept csi BAM indexes in meta.yml, quote the prepon error for PON
headers with extra contigs, and unquote withName selectors in the test config.

Generated by Claude Opus 5.5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* parabricks/rnafq2bam: stop pbrun log overwriting STAR Log.final.out (nf-core#13493)

--logfile and --out-prefix both wrote ${prefix}.Log.final.out, so the
emitted log_final held the pbrun run log instead of STAR's alignment
summary. Write the pbrun log to ${prefix}.pbrun.log, and assert in the
tests that log_final contains STAR's mapping stats.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Add scdblfinder module (nf-core#13465)

* new module: scdblfinder

* scdblfinder: add container metadata, conda locks and test snapshot

* scdblfinder: gzip the h5ad and return boolean doublet predictions

Write the h5ad with gzip compression, as in the other scdownstream modules.

The predictions output is now a CSV with a single boolean column (true for
doublets), named after the prefix and indexed by cell barcode. This matches
the layout of the other doublet detection modules, so scdownstream can combine
them. The full scDblFinder table (class, score and related columns) moves to
a new scores output.

* scdblfinder: pass options through ext.args and address review comments

Take only the meta and h5ad as inputs and pass dbr, samples and other
scDblFinder options through task.ext.args, with a tests/nextflow.config that
sets ext.args from params.module_args. A single string given as samples is
read as the name of an obs column.

Use ${prefix} in the output paths instead of globs, add the YAML ontology to
the versions entries in meta.yml, name the test closure parameters, and
snapshot the predictions file in the real tests.

* scdblfinder: report all package versions and snapshot sanitizeOutput

Report the versions of anndataR, SingleCellExperiment, BiocParallel and rhdf5
in versions.yml, in the template and in the stub.

Snapshot sanitizeOutput(process.out) in the real tests, with the h5ad and
scores channels as unstable keys and the scores line count alongside.

Add the nf-core licence header to main.nf, shorten the predictions
description in meta.yml and drop a comment that repeated the code.

* Bump fgumi to 0.9.0 (nf-core#13496)

* bump fgumi to 0.9.0

* bump snaps

* gatk4/haplotypecaller: emit realigned BAM index (nf-core#13460)

When --bam-writer-type is set, HaplotypeCaller writes <prefix>.realigned.bai
next to the realigned BAM (BAM index creation is on by default), but only
the BAM was declared as an output. The index was therefore not staged out
of the task work dir when scratch is enabled, and could not be reliably
passed downstream.

Add an optional `bai` output (*.realigned.bai), create it in the stub, and
document it in meta.yml. Add a stub test covering the new output.


Claude-Session: https://claude.ai/code/session_01N14QD6WfKfDC1pFysaurQL

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Matthias De Smet <11850640+matthdsm@users.noreply.github.com>

* new module: celltypist (nf-core#13438)

* new module: celltypist

* celltypist: add a real test and point the model input at a .pkl

The stub-only test passed an .h5ad as the model. Both tests now use a
normalised pbmc3k query and a small CellTypist model, to be added to
nf-core/test-datasets. The snapshot will be regenerated once that data
is available.

* celltypist: add test snapshot

* celltypist: apply prettier quoting to meta.yml

* celltypist: check output line counts instead of checksums

The scores in the CSV outputs are floating point values that can differ in the
last digits between platforms, so the real test now checks the number of lines
in each file and snapshots only the versions.

* celltypist: use a Seqera container and expose the optional files

Build the container with nf-core modules containers create and add the
containers block and conda lock files.

Add the optional over_clustering, gene_file and cell_file inputs, and the
optional xlsx and plots outputs. The CSV outputs are optional as well, since
CellTypist writes only the Excel file when --xlsx is used.

Use ${prefix} in the output names instead of globs, add tests/nextflow.config
for ext.args, add a test for --xlsx and --plot-results, and snapshot
sanitizeOutput(process.out) in the tests.

* celltypist: follow ext.args in the stub and test the optional inputs

Make the stub write the Excel workbook and the plot instead of the three CSV
files when --xlsx and --plot-results are given.

Add a test for over_clustering with --majority-voting, using a label file
generated in the test, and move the line counts into the snapshots.

Widen the h5ad input pattern to the formats CellTypist accepts and add EDAM
terms to the input formats in meta.yml.

* celltypist: test matrix market input and majority voting

Add a test with a small matrix market input and gene and cell files generated
in the test, and snapshot the header of the majority voting labels file.

Snapshot the checksum of predicted_labels in the plain test.

Add the binary format term for the model in meta.yml and shorten the
descriptions, starting the output descriptions with "Optional".

* celltypist: snapshot the majority voting labels checksum

The labels file is the same on every run when an over-clustering file is
given, so snapshot its checksum instead of exempting it and checking only the
header line.

* varnet: bump to 1.5.4, version from --version, tumor-only support (nf-core#13147)

* varnet: bump to 1.5.4, report version from --version, support tumor-only mode

* varnet/filter: sort candidates so the output does not depend on the filesystem

* varnet: take the tumor-only resources as individual files, staged with stageAs

* summarizedexperiment: keep all-NA sample columns so assays stay aligned (nf-core#13498)

* summarizedexperiment: keep all-NA sample columns so assays stay aligned

A sample with no reads is all zero in counts but all NA after length
scaling, and an all-NA column is read as logical, so it was dropped from
that matrix only and checkRowColNames() stopped with "Rows or columns
different among input matrices". Keep an all-NA column when the same
column is numeric in another matrix; all-NA annotation columns are still
dropped. Adds a regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* summarizedexperiment: coerce only all-NA columns; snapshot versions in new test

Test columns by position rather than by name (duplicate names survive
read_delim_flexible), and convert only the logical all-NA columns to
numeric so integer count assays keep their type. The new test now
snapshots versions like the other tests and writes its inputs line by
line with sort: false so the header stays first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* summarizedexperiment: warn on dropped all-NA columns; check samples in test

Warn when an all-NA column is dropped because it is not numeric in any
input matrix, so a sample that is all-NA everywhere no longer disappears
silently. Coerce only the kept all-NA columns.

Print the SummarizedExperiment summary at the end of the session log, and
have the all-NA test assert that both assays and both samples are present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Update ampcombi module to use Seqera container (nf-core#13504)

* Update ampcombi2 module to use Seqera containers (nf-core#13506)

* Update angsd module to use Seqera Containers (nf-core#13508)

* Update angsd module to use Seqera Containers

* Restore meta.yml schema lines and update angsd snapshots

The Seqera container (angsd 0.940 with htslib 1.17) produces different
md5s for the contamination and GL soapsnp outputs, so the affected
snapshots were regenerated on linux/amd64.

Generated by Claude Opus 5.5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Fix typo and implement multiple testing scenarios

* Update snapshot

* Fix linting

* Remove unstable file from snapshot

* Get summary name and line count in snapshot

---------

Co-authored-by: Evangelos Karatzas <32259775+vagkaratzas@users.noreply.github.com>
Co-authored-by: Friederike Hanssen <Friederike.hanssen@qbic.uni-tuebingen.de>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jonathan Manning <jonathan.manning@seqera.io>
Co-authored-by: Iraaj G. <98648540+iraajgangavaram@users.noreply.github.com>
Co-authored-by: Matthias De Smet <11850640+matthdsm@users.noreply.github.com>
Co-authored-by: Anders Sune Pedersen <37172585+asp8200@users.noreply.github.com>
Co-authored-by: Kiran Krishnamachari <kirankchari@gmail.com>
Co-authored-by: Pauline Fourgoux <20558943+paulinefx@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants